﻿Public Class clsHWSetting
    Public Function selectByWorkshop(ws As String) As DataTable
        Dim szSql As String = String.Empty
        szSql &= "SELECT * "
        szSql &= "  FROM sf.t_hw_setting "
        szSql &= "  WHERE factory_id =? "
        szSql &= "  AND workshop_id = ? "
        szSql &= "  ORDER BY workshop_id,equip_id "

        Dim dt As DataTable = DBacs.ExecuteSql(szSql, -1, "TS", ws)
        If IsNothing(dt) Then
            selectByWorkshop = New DataTable
        Else
            selectByWorkshop = dt
        End If
    End Function

    Public Function selectByType(ws As String, type As String) As DataTable
        Dim szSql As String = String.Empty
        szSql &= "SELECT * FROM sf.t_hw_setting "
        szSql &= " WHERE factory_id = ? AND workshop_id = ? AND equip_type_id = ? ORDER BY workshop_id,equip_id "
        Dim dt As DataTable = DBacs.ExecuteSql(szSql, -1, "TS", ws, type)
        If IsNothing(dt) Then
            selectByType = New DataTable
        Else
            selectByType = dt
        End If
    End Function

End Class
